package org.domeos.framework.api.biz.resource;

import org.domeos.framework.api.biz.base.BaseBiz;
import org.domeos.framework.api.model.auth.related.Role;
import org.domeos.framework.api.model.resource.Resource;
import org.domeos.framework.api.model.resource.related.ResourceOwnerType;
import org.domeos.framework.api.model.resource.related.ResourceType;

import java.util.List;

/**
 * Created by feiliu206363 on 2016/4/5.
 */
public interface ResourceBiz extends BaseBiz {

    void save(int resourceId, ResourceType resourceType, int ownerId, ResourceOwnerType s, Role role);

    void save(Resource resource);

    Resource getByUserAndResourceId(int userId, int resourceId, ResourceType resourceType);

    Resource getGroupResourceByResourceId(int resourceId, ResourceType resourceType);

    List<Resource> listByType(ResourceType resourceType);

    List<Resource> listByUserId(int userId, ResourceType resourceType);

    List<Resource> getGroupListByUserId(int userId, ResourceType resourceType);

    List<Resource> getByResourceIdAndType(int resourceId, ResourceType type);

    List<Resource> listByOwnerId(int groupId, ResourceOwnerType type, ResourceType project);

    void deleteByIdAndType(int resourceId, ResourceType type);

    List<Resource> getGroupByUserId(int id, String name, ResourceType resourceType);

    void delete(ResourceType resourceType, int resourceId, ResourceOwnerType ownerType, int ownerId);

    Resource get(int userId, ResourceOwnerType user, int resourceId, ResourceType resourceType);

    Resource getGroup(String name, int resourceId, ResourceType resourceType);

    void modify(Resource resource);
}
